﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Dragon
{
    public partial class wfLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            DataView dv = (DataView)this.sdsLogin.Select(DataSourceSelectArguments.Empty);
            if (dv == null || dv.Table.Rows.Count == 0 || dv.Table.Rows[0][0].ToString().Trim() == "")
            {
                this.lblInfo.Text = "Tên đăng nhập hoặc mật khẩu không hợp lệ!";
                Session["Username"] = null;
                Session["Fullname"] = null;
                Session["UserType"] = null;
            }
            else
            {
                Session["Username"] = dv.Table.Rows[0]["Username"].ToString();
                Session["Fullname"] = dv.Table.Rows[0]["Fullname"].ToString();
                Session["UserType"] = dv.Table.Rows[0]["UserType"].ToString();
                Response.Redirect("~/wfSMSMonthly.aspx");
            }
        }       
    }
}